<?php 

/* 
Template Name: Staff 
*/ 

?>

<?php get_header(); ?>

<!-- BEGIN #main-content -->
<div id="main-content-staff">
		
    <h1 class="page-title">
            <?php the_title(); ?>
    </h1>

    <?php if (function_exists('dimox_breadcrumbs')) dimox_breadcrumbs(); ?>
		
    <!-- BEGIN .page-content -->
    <div class="page-content">

        <?php 
            $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
            $query_parameters = array(
                                'post_type' => 'staff',
                                'posts_per_page' => 8,
                                'paged' => $paged,
                                'order' => 'desc',
                                'orderby' => 'date'
                        );
        
            $wp_query = new WP_Query($query_parameters); ?>
        
        <?php if ( $wp_query->have_posts() ) : ?>

            <ul class="clearfix">
                <?php 
                    while ( $wp_query->have_posts() ) : 
                        $wp_query->the_post(); ?>
                        <?php get_template_part( 'loop', 'staff' ); ?>
                <?php endwhile; ?>
            </ul>

            <?php load_template( get_template_directory() . '/includes/pagination.php' ); ?>

        <?php else : ?>
            <p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'qns' ); ?></p>
        <?php endif; ?>	

    <!-- END .page-content -->
    </div>
		
<!-- BEGIN #main-content -->
</div>

<?php get_footer(); ?>